Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gro's initial choice between swc and esbuild was informed by the fact that swc worked out of the box on Svelte component JS/TS, and esbuild did not. This problem is now solved by esbuild's 0.8.28 and svelte-preprocess-esbuild.
The main caveat is that Svelte files must use
import typefor types or it'll throw a runtime error. (can this be fixed? where?) We also are supposed to turn onisolatedModulesfor TypeScript to work with esbuild, but it currently conflicts how we usesrc/globalTypes.tsas declarations, so we have it off, meaning TypeScript won't warn us when we use an incompatible feature. When TypeScript supports package exports in 4.3, we should be able to properly design the global types, and fix like a dozen other weird things.So this resurfaces the question, swc or esbuild? Today, esbuild is far ahead in maturity and docs. The speed difference is likely not significant. (in my quick tests transforming the files of 2 projects, swc was faster than esbuild by about 10-15%, though I've heard esbuild does better for a lot of workloads, there may be optimizations we could add, both projects could change, but my guess is they'll remain in the same ballpark) I think swc has a bright future as a platform, but today I think it's clear esbuild is going to give us better results. I'm not sure which is the better long term tool for Gro to build on, but luckily Gro users should be mostly shielded from this decision, and we can revisit it as the ecosystem matures.
todo
esbuildpreprocessoresbuildbuilderesbuildto 0.9 and submit PR tosvelte-preprocess-esbuildsvelte-preprocess-esbuild